﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using System.IO;
using mesoBoard.Data;
using mesoBoard.Data.Repositories;
using System.Drawing.Imaging;
using System.Drawing;

namespace mesoBoard.Services
{
    public class Messages : IMessages
    {
         
        private IRepositoriesWrapper Repositories;

        public Messages(IRepositoriesWrapper repos)
        {
            this.Repositories = repos;
        }

        public IEnumerable<Message> GetUnreadMessages(int UserID)
        {
            return Repositories.Messages.GetAllMessagesByUser(UserID).Where(x => x.ToUserID == UserID && !x.IsRead && !x.ToDelete);
        }
    }
}